#-*- encoding: utf-8 -*-
'''
Created on 2011-10-28

@author: Botao Wu
'''
import random

def qsort(L):
    '''快速排序算法'''
    if not L: return []
    return qsort([x for x in L[1:] if x < L[0]]) + L[0:1] + qsort([x for x in L[1:] if x >= L[0]])

if __name__ == '__main__':
    s = [random.randint(0, 100) for i in range(0, 20)]
    print s
    print qsort(s)